package com.user.gamecenter.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.user.gamecenter.service.SystemHostService;
import com.xdandroid.hellodaemon.DaemonEnv;

/**
 * author : Administrator
 * e-mail : 254419013@qq.com
 * time   : 2017/06/29
 * desc   :
 */
public class BootReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        startSystemHostService(context);
    }

    private void startSystemHostService(Context context) {
        DaemonEnv.initialize(context, SystemHostService.class, DaemonEnv.DEFAULT_WAKE_UP_INTERVAL);
        try {
            context.startService(new Intent(context, SystemHostService.class));
        } catch (Exception ignored) {
        }
    }
}
